let components = []

// const requireComponents = require.context('./', true, /\.vue/);
// requireComponents.keys().forEach(fileName => {
//   let path = fileName.replace(/.vue$/, '').split('/')
//   if (path.length == 3) {
//     const reqCom = requireComponents(fileName)
//     components.push({
//       path: '/' + path[1] + '/' + path[2],
//       component: reqCom.default || reqCom,
//     });
//   }
// });

const comps = {
  widgets: `Ajax Album Alert Button ButtonBar Calendar Checkbox CheckboxGroup Combobox CommandFunction Confirm Datepicker Dialog DocView Dropbox Fileupload Form Grid Hidden
   Horizontal Html Imageupload Img Jigsaw Label Leaf Linkbox Loading Mediaupload Menu Option Pagebar Password Pickbox Pop Progress Radio RadioGroup Range
   SlidePicker Spinner Split Submit SubmitButton Swiper SwiperItem Switch Tab Table TableColumn TableColumns TableTBody TableTD TableTH TableTHead TableTR TableV2 Tabs Text Textarea 
   Timeline TimelineItem Tip Toggle Tree TreeV2 Triplebox Vertical Video View Rate`,
  methods: `ajax.delete ajax.get ajax.put ajax.post ajax alert br config confirm dateAdd dateDiff dateFormat dateParse dateSheet dfish download numAdd numFormat previewImage 
    previewVideo print q scrollIntoView strFrom strHighlight strTo urlParam vm cssvar WIDGET`,
  directives: `v-form-ignore v-dialog-move`,
  source: `Fonticon`
}

Object.keys(comps).forEach(key => {
  comps[key].split(' ').forEach(item => {
    item = item.trim()
    components.push({
      path: `/${key}/${item}`,
      component: () => import(`@/views/${key}/${item}`)
    })
  })
})

export {
  components
};
